//
//  ListenDataSongsModel.m
//  NewMusic
//
//  Created by dllo on 15/11/12.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "ListenDataSongsModel.h"
#import "SongsAuditionListModel.h"
@implementation ListenDataSongsModel
-(instancetype)initWithDictionary:(NSDictionary *)dictionary {
    self = [super init];
    if (self) {
        self.auditionList = [NSMutableArray array];
        self.urlList = [NSMutableArray array];
        self.mvList = [NSMutableArray array];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
-(void)setValue:(id)value forUndefinedKey:(NSString *)key {

}
-(void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"songId"]) {
//        NSLog(@"%@", value);
        self.songId = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"singerId"]) {
//        NSLog(@"%@", value);
        self.singerId = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"albumId"]) {
        self.albumId = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"favorites"]) {
        self.favorites = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"originalId"]) {
        self.originalId = [NSString stringWithFormat:@"%@", value];
    }else if ([key isEqualToString:@"auditionList"]) {
        NSArray *array = (NSArray *)value;
        for (NSDictionary *dic in array) {
            SongsAuditionListModel *model = [[SongsAuditionListModel alloc]initWithDictionary:dic];
            [self.auditionList addObject:model];
            [model release];
        }
    }else if ([key isEqualToString:@"urlList"]) {
        NSArray *array = (NSArray *)value;
        for (NSDictionary *dic in array) {
            SongsAuditionListModel *model = [[SongsAuditionListModel alloc]initWithDictionary:dic];
            [self.urlList addObject:model];
            [model release];
        }
    }else if ([key isEqualToString:@"mvList"]){
        NSArray *array = (NSArray *)value;
        for (NSDictionary *dic in array) {
            SongsAuditionListModel *model = [[SongsAuditionListModel alloc]initWithDictionary:dic];
            [self.mvList addObject:model];
            [model release];
        }

    }else {
        [super setValue:value forKey:key];
        
    }
}
@end
